@mixin image-icon {
  line-height: 28px;
  margin: 0 4px;
  padding: 0 4px;
  min-width: 28px;
  display: inline-block;
  text-align: center;
  color: #babbc0;
  border-radius: 2px 2px;
  text-decoration: none;
  -webkit-transition: background-color 0.3s ease-in-out;
  transition: background-color 0.3s ease-in-out;
  cursor: pointer;
  vertical-align: bottom;

  i {
    display: block;
    font-size: 16px;
    color: #252b3a;
    line-height: 28px;
  }

  svg {
    display: block;
    line-height: 28px;
    margin: 6px 0;
    margin-left: 2px;
  }
  &:hover {
    background-color: #aaaaaf;
  }
}

.ql-image-bar {
  position: absolute;
  transform: translateY(10px);
  transition: width 0.5s ease-in-out; /* 动画持续0.5秒，平滑过渡宽度变化 */
  align-items: center;
  background-color: #fff;
  border: 1px solid #adb0b8;
  box-shadow: 0 0 5px rgba(37, 43, 58, 0.2);
  color: #252b3a;
  display: flex;
  padding: 4px;
  white-space: nowrap;

  .ql-split {
    width: 1px;
    height: 16px;
    line-height: 16px;
    margin: 4px 8px;
    vertical-align: bottom;
    border-left: 1px solid #adb0b8;
  }
  .ql-image-preview {
    @include image-icon;
    .icon-preview {
      font-family: 'iconfont' !important;
      font-size: 16px;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      &::before {
        content: '\e600';
      }
    }
  }
  .ql-image-download {
    @include image-icon;
    .icon-download {
      font-family: 'iconfont' !important;
      font-size: 16px;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      &::before {
        content: '\e600';
      }
    }
  }
  .ql-image-copy {
    @include image-icon;
  }
  .ql-image-delete {
    @include image-icon;
    .icon-delete {
      font-family: 'iconfont' !important;
      font-size: 16px;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;

      &::before {
        content: '\ec45';
      }
    }
  }
}
